package com.example.serviceorder.remote;

import com.example.internalcommon.dto.PriceRule;
import com.example.internalcommon.dto.ResponseResult;
import com.example.internalcommon.request.PriceRuleIsNewRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author lyra
 * @Date 2023/4/24 10:18
 **/
@FeignClient("service-price")
public interface ServicePriceClient {
    @RequestMapping(method = RequestMethod.POST,value = "/price-rule/is-new")
    ResponseResult<Boolean> isNew(@RequestBody PriceRuleIsNewRequest priceRuleIsNewRequest);

    @RequestMapping(method = RequestMethod.POST,value = "/price-rule/if-exists")
    ResponseResult<Boolean> ifPriceExists(@RequestBody PriceRule priceRule);

    @RequestMapping(method = RequestMethod.POST,value = "/calculate-price")
    ResponseResult<Double> calculatePrice(@RequestParam Integer distance,@RequestParam Integer duration, @RequestParam String cityCode ,@RequestParam String vehicleType);
}
